Skip to content

fix(specifiers): withhold all generated definitions pending clinician review#691

Merged
BigSimmo merged 3 commits into
mainfrom
claude/specifiers-v2-design-r55baf
Jul 17, 2026
Merged

fix(specifiers): withhold all generated definitions pending clinician review#691
BigSimmo merged 3 commits into
mainfrom
claude/specifiers-v2-design-r55baf

Conversation

@BigSimmo

@BigSimmo BigSimmo commented Jul 17, 2026

Copy link
Copy Markdown
Owner

Summary

Follow-up to the DSM-5-TR specifier catalogue (#656). During that PR's review, automated reviewers repeatedly surfaced clinically wrong auto-generated text on rows whose source was "verified" — gaming online/offline subtypes, PTSD/Conduct threshold notes, AMPD provenance, BED severity notes, "with/without possession" meanings, and more. Each was corrected individually, but the pattern showed that source-verified only attests the specifier's existence/attribution — not that the generated definition text is clinically correct. For a decision-support tool, displaying any of that text as trusted is unsafe.

This change withholds the generated definition text on every catalogue row (not just the ~514 already gated), pending clinician-authored definitions:

  • specifier-reference-page.tsx: every catalogue detail page now shows the "definition pending qualified clinician verification" notice instead of the generated meaning/clinical-note. Still shown: the specifier's structural facts (label, disorder, group, ICD-11 context), the source/review-status badges, and the hand-authored curated fit/exclusion guidance for the 14 curated mood specifiers.
  • data/specifiers-search-index.json: the 71 remaining meaning fields are blanked, so no generated definition text is displayed or ranked on client-side.
  • tests/specifiers-content.test.ts: asserts the client index carries no generated definition text.

Unchanged: the full 585-item catalogue, search, routing, provenance badges, and structure. The nested content dataset (data/specifiers-content.json) is left intact so a future clinician-reviewed regeneration can restore verified definitions without re-importing.

Verification

Run in-sandbox (CI runs the full gates):

  • Next.js production build compiled successfully; no type errors in any changed src/ file (the only tsc failures are the pre-existing uninstalled test deps @testing-library/* / @axe-core/playwright).

  • ESLint + Prettier clean on all changed files.

  • Vitest: tests/specifiers-content.test.ts + tests/specifiers.test.ts27/27 pass; the client index now exposes 0 generated definitions.

  • npm run verify:pr-local

  • npm run verify:ui — detail/search copy changed; worth a Chromium pass

  • npm run check:production-readiness — clinical output/source-governance surface changed

Clinical Governance Preflight

  • Source-backed claims still require linked source verification before clinical use — this change strengthens that: no generated definition text is presented as trusted; every row is shown as pending clinician verification.
  • No patient-identifiable document workflow was introduced or expanded.
  • Supabase target unchanged (Clinical KB Database / sjrfecxgysukkwxsowpy) — no Supabase changes.
  • Service-role keys and private document access remain server-only — no change.
  • Demo/synthetic content remains clearly separated — no change.
  • Source metadata, review status, and outdated/unknown-source behavior remain conservative — this makes them more conservative (withhold generated definitions entirely).
  • Deployment classification / TGA SaMD impact — reduces displayed decision-support content, so lower risk than feat(specifiers): add full DSM-5-TR catalogue with verification gate #656; a reviewer should still confirm classification.

Notes

  • The underlying fix is a clinician review of the catalogue definitions; this PR removes the interim risk of displaying unreliable generated text until that happens.
  • A separate source-verification report (attempting to check the definitions against DSM-5-TR / ICD-11) is being prepared to seed that clinician review.

🤖 Generated with Claude Code


Generated by Claude Code

Summary by CodeRabbit

  • Content Updates
    • Updated ARFID ICD-11 wording to describe “apparent lack of interest in eating or food” (instead of the limited-availability phrasing).
    • Cleared generated “meaning” text from compact specifier search records.
  • User Experience
    • Specifier pages now withhold generated meaning whenever a definition is present and show a “Definition pending verification” notice instead.
    • Removed the “Meaning” and “Clinical note” cards from the overview section.
  • Tests
    • Updated assertions to match the new definition/meaning display behavior and ARFID wording.

… review

Follow-up to the DSM-5-TR specifier catalogue (#656). Automated review
repeatedly surfaced clinically wrong auto-generated text among the rows
whose SOURCE was verified (gaming subtypes, PTSD/Conduct threshold notes,
AMPD provenance, BED severity notes, possession meanings, ...). "Source
verified" only attests the specifier's existence/attribution, not that the
generated definition text is clinically correct, so displaying any of it as
trusted is unsafe for a decision-support tool.

Withhold the generated meaning/clinical-note for ALL catalogue rows — not
just the previously-ungated ~514 — until a clinician authors real
definitions:

- specifier-reference-page.tsx: every catalogue detail page now shows the
  "definition pending qualified clinician verification" notice instead of
  generated meaning/clinical-note. Structural facts (label, disorder,
  group, ICD-11 context), the source/review badges, and the hand-authored
  curated fit/exclusion guidance are still shown.
- specifiers-search-index.json: blank all 71 remaining meaning fields so no
  generated definition text is displayed or ranked on client-side.
- tests: assert the client index carries no generated definition text.

The full 585-item catalogue, search, routing, provenance badges, and
structure are unchanged. The nested content dataset is left intact so a
future clinician-reviewed regeneration can restore verified definitions.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WmtoUEnX7Pe4yipAmPFSiG
@supabase

supabase Bot commented Jul 17, 2026

Copy link
Copy Markdown

This pull request has been ignored for the connected project sjrfecxgysukkwxsowpy because there are no changes detected in supabase directory. You can change this behaviour in Project Integrations Settings ↗︎.


Preview Branches by Supabase.
Learn more about Supabase Branching ↗︎.

@coderabbitai

coderabbitai Bot commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 091c3649-f0e9-444c-9268-0a1e6964fb9c

📥 Commits

Reviewing files that changed from the base of the PR and between ac2788e and 61d703e.

📒 Files selected for processing (1)
  • src/components/specifiers/specifier-reference-page.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/components/specifiers/specifier-reference-page.tsx

📝 Walkthrough

Walkthrough

The PR revises ARFID ICD-11 wording, removes generated meaning text from the compact specifier index, changes reference-page verification gating, and updates tests for the new content behavior.

Changes

Specifier definition updates

Layer / File(s) Summary
Catalog and search-index content updates
data/specifiers-content.json, data/specifiers-search-index.json
ARFID wording now describes apparent lack of interest in eating or food, while generated meaning text is cleared across affected specifiers.
Reference-page definition gating
src/components/specifiers/specifier-reference-page.tsx
Generated definitions are withheld whenever present; the page shows pending-verification messaging and removes meaning and clinical-note cards.
Content and index validation
tests/specifiers-content.test.ts
Tests verify empty indexed meanings and the revised ARFID labeling.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Possibly related issues

Possibly related PRs

  • BigSimmo/Database#656: Both changes modify specifier verification gating, search-index meaning content, and related tests.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: withholding generated definitions pending clinician review.
Description check ✅ Passed The description follows the template with Summary, Verification, Clinical Governance Preflight, and Notes, and provides relevant implementation and test details.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/specifiers-v2-design-r55baf

Comment @coderabbitai help to get the list of available commands.

Source verification against ICD-11 6B83 found the ARFID feature labelled
"With inadequate food intake associated with limited availability" names an
ICD-11 EXCLUSION ("unavailability of food") rather than a driver. The genuine
third ARFID driver — alongside sensory-based avoidance and fear of aversive
consequences — is an apparent lack of interest in eating / low appetite.

Relabel it accordingly in the content dataset and the client index (rowKey/slug
kept stable to avoid breaking URLs), and add a regression test.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WmtoUEnX7Pe4yipAmPFSiG

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/components/specifiers/specifier-reference-page.tsx`:
- Line 133: Update the unlabeled-item message in the specifier reference
rendering branch to avoid hardcoding DSM-5-TR. Reuse the existing “DSM-5-TR /
ICD-11” source-neutral wording, or derive the correct manual from sourceManual,
while preserving the current item.label and item.disorderName details.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 7cc63fd4-018a-405c-8f5f-c25e0c94ed8c

📥 Commits

Reviewing files that changed from the base of the PR and between d7d12b5 and ac2788e.

📒 Files selected for processing (4)
  • data/specifiers-content.json
  • data/specifiers-search-index.json
  • src/components/specifiers/specifier-reference-page.tsx
  • tests/specifiers-content.test.ts

Comment thread src/components/specifiers/specifier-reference-page.tsx Outdated
CodeRabbit: the "no separate definition" branch of the reference-page
description hardcoded "DSM-5-TR", so an ICD-11 item without a definition
told users to read it against the wrong manual. Use the per-item
sourceManual label (DSM-5-TR or ICD-11) already derived for the badge.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WmtoUEnX7Pe4yipAmPFSiG
@BigSimmo
BigSimmo merged commit cc754c4 into main Jul 17, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants